package com.springboot.spring01ioc.service;


import lombok.ToString;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

//感知接口：XXXAware
@Service
@ToString
public class EnvironmentService implements EnvironmentAware {
    private  Environment environment;

    @Override
    public void setEnvironment(Environment environment) {
        this.environment = environment;
    }
    public String getOSType()
        {
        return environment.getProperty("OS");
    }
}
